package com.ctgu.expresshelper.dao;

import com.ctgu.expresshelper.entity.Address;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface AddressDao {

    @Select("select * from address where userid=#{userId}")
    List<Address> getAllShopByUserId(int userId);

    @Delete("delete  from address where id=#{id}")
    int deleteAddressById(int id);

    @Update("update address set address=#{address} where id =#{id}")
    void updateAddressById(Address address);

    @Insert("insert into address(address,userid) values (#{address},#{userid}) ")
    void addAddress(Address address);
}
